from re import search

from appium.webdriver.common.appiumby import AppiumBy

from base.search_base import SearchBase


class Searchpage(SearchBase):
    def search_bar_for_input_send(self,driver,value):
        search_bar_for_input_xpath = self.search_bar_for_input()
        return self.send_keys_new(driver,AppiumBy.XPATH,search_bar_for_input_xpath,value)

    def search_bar_button_click(self,drivre):
        search_bar_button_xpath = self.search_bar_button()
        return self.click_new(drivre,AppiumBy.XPATH,search_bar_button_xpath)

    def get_assert_value(self,drivr):
        book_title_xpath = self.book_title()
        return self.get_text(drivr,AppiumBy.XPATH,book_title_xpath)
